@extends('admin.layouts.app')
@section('content')

                        <div class="row">
                            <div class="col-sm-12">
                                <h4 class="page-title">工单管理</h4>
                                <ol class="breadcrumb">
                                    <li><a href="#">系统</a></li>
                                    <li><a href="{{url('zadmin/task')}}">任务管理</a></li>
                                    <li class="active">任务详情</li>
                                </ol>
                            </div>
                        </div>
                        
                        <div class="row">
                        	<div class="col-lg-12">
                        		<div class="card-box">
                            <h2 class="m-t-0 header-title">工单详情</h2>
                            <hr/>
                             
      <div class="row">
			   <div class="col-md-9">
                                 
            <table class="table table-hover">
               <!--  <tr>
                  <td>资产编号</td>
                  <td><strong>{{$data->title}}</strong></td>
                </tr> -->
                <tr>
                  <td>姓名</td>
                  <td>{{$data->truename}}</td>
                </tr>
                <tr>
                  <td>手机号</td>
                  <td>{{$data->mobile}}</td>
                </tr>
                <tr>
                  <td>类型</td>
                  <td>{{object_get($data,'category.name')}}</td>
                </tr>
                <tr>
                  <td>内容</td>
                  <td>{{$data->content}}</td>
                </tr>
                <tr>
                  <td>图像</td>
                  <td><img src="{{$data->pic}}" width="600" /></td>
                </tr>
               
                <tr>
                  <td>当前状态</td>
                  <td><label class="label label-{{$taskStatus[$data->status]['style']}}">{{$taskStatus[$data->status]['txt']}}</label></td>
                </tr>
                
              </table>
            </div>
            @if($wechatInfo)
            <div class="col-md-3">
                <table class="table table-hover">
                <tr>
                  <td>微信昵称</td>
                  <td><strong>{{$wechatInfo['nickname']}}</strong></td>
                </tr>
                <tr>
                  <td>微信头像</td>
                  <td><img src="{{$wechatInfo['headimgurl']}}" width="100" /></td>
                </tr>
              </table>
            </div>
            @endif
          </div>
              <hr/>
              @if(count($process))
              <div class="row">
              <h4>派工信息</h4>       
                     <div class="col-md-12">
                     <table class="table">
                      <tr>
                        <th>维修人</th>
                        <th>备注</th>
                        <th>工单状态</th>
                        <th>派工时间</th>
                      </tr>
                       @foreach($process as $pro)
                       <tr>
                        <td>
                     {{$pro->worker->truename or ''}}({{$pro->worker->mobile or ''}})</td>
                      <td>
                        {{$pro->remark}} &nbsp;&nbsp; 
                        </td>
                        <td><label class="label label-{{$taskStatus[$pro->status]['style']}} ">{{$taskStatus[$pro->status]['txt']}}</label>
                      </td>
                      <td>{{$pro->created_at}}               
                      </td>
                      </tr>
                       @endforeach
                        </table>
                     </div>
                </div>     
                     
             
              @endif
              
              
              
                                              
                                           
                            
                                          
       	                        	
			</div>
    </div>
                                
                            </div> <!-- end col -->

                            
                      
@endsection
                        
  @section('js')
  <script src="{{asset('admin/js/jquery.printPage.js')}}"></script>
  <script type="text/javascript">
      $(document).ready(function() {
        $(".btnPrint").printPage({
          url:"{{url('zadmin/task/print',$data->id)}}",
          attr:"href",
        });
      });

    $('.task-btn').on('click',function(){
      var status = $(this).data('status');
      $('input[name="status"]').val(status);
      $('#form1').submit();
    });
    
  </script>


@endsection                      
                        

                  
            
        
       

           



    
        
    
